#! /usr/bin/env python3
# -*- coding: utf-8 -*-

class ListStack:
    """基于列表实现的顺序栈"""

    def __init__(self):
        self.items = []

    def push(self, item) -> bool:
        self.items.append(item)
        return True

    def pop(self):
        self.items.pop()

    def __repr__(self):
        return str(self.items)


if __name__ == '__main__':
    stack = ListStack()
    for i in range(4):
        print("stack.push(%d):" % i, stack, stack)
